﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Bilibili.Model.Dynamic
{
    public sealed class DynamicFeed
    {
        public List<EmojiDetails> emoji_details { get; set; }
        public DynamicFeed item { get; set; }
        public long dynamic_id { get; set; }
        public string content { get; set; }
        public string ctrl { get; set; }
        public string title { get; set; }
        public long uid { get; set; }
        public int orig_type { get; set; }
        public string origin { get; set; }
        public long orig_dy_id { get; set; }
        public DynamicVideo video
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 8)
                    return origin.ToObject<DynamicVideo>();
                else
                    return null;
            }
        }
        public DynamicArticle article
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 64)
                    return origin.ToObject<DynamicArticle>();
                else
                    return null;
            }
        }
        public DynamicFeedNew photo
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 2)
                    return origin.ToObject<DynamicFeedNew>();
                else
                    return null;
            }
        }
        public DynamicFeedNew text
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 4)
                    return origin.ToObject<DynamicFeedNew>();
                else
                    return null;
            }
        }
        public DynamicWeb web
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 2048)
                    return origin.ToObject<DynamicWeb>();
                else
                    return null;
            }
        }
        public DynamicBangumi bangumi
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 512)
                    return origin.ToObject<DynamicBangumi>();
                else
                    return null;
            }
        }
        public DynamicMusic music
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 256)
                    return origin.ToObject<DynamicMusic>();
                else
                    return null;
            }
        }
        public DynamicMiniVideo minivideo
        {
            get
            {
                if (origin != null && origin.Length != 0 && item.orig_type == 16)
                    return origin.ToObject<DynamicMiniVideo>();
                else
                    return null;
            }
        }
        public DynamicFeed origin_extension { get; set; }
        public VoteCfg vote_cfg { get; set; }
        public string lott { get; set; }
    }
}